package com.christina.engine.intent.model;

import lombok.Data;
import lombok.Builder;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 意图上下文模型
 * 
 * @author Christina
 */
@Data
@Builder
public class IntentContext {
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 会话ID
     */
    private String sessionId;
    
    /**
     * 当前时间
     */
    private LocalDateTime currentTime;
    
    /**
     * 用户位置信息
     */
    private LocationInfo location;
    
    /**
     * 历史对话记录
     */
    private List<ConversationHistory> conversationHistory;
    
    /**
     * 用户偏好设置
     */
    private Map<String, Object> userPreferences;
    
    /**
     * 设备信息
     */
    private DeviceInfo deviceInfo;
    
    /**
     * 环境变量
     */
    private Map<String, String> environmentVariables;
    
    /**
     * 位置信息
     */
    @Data
    @Builder
    public static class LocationInfo {
        private String country;
        private String province;
        private String city;
        private Double latitude;
        private Double longitude;
        private String timezone;
    }
    
    /**
     * 对话历史
     */
    @Data
    @Builder
    public static class ConversationHistory {
        private String userInput;
        private String assistantResponse;
        private Intent recognizedIntent;
        private LocalDateTime timestamp;
    }
    
    /**
     * 设备信息
     */
    @Data
    @Builder
    public static class DeviceInfo {
        private String platform;    // web, mobile, desktop
        private String deviceType;  // phone, tablet, computer
        private String userAgent;
        private String ipAddress;
        private String location;
    }
}